package com.example.cargetter.controller;


import com.example.cargetter.mqtt.MqttPushClient;
import com.example.cargetter.utils.MqttDataUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("mqtt")
@Slf4j
public class MqttController {

    @Autowired
    private MqttPushClient mqttPushClient;

    @GetMapping("/traffic")
    public String getMqttData() {
        log.info("红绿灯数据查询：");
        return MqttDataUtils.getInstance().get("test/publish");
    }

}
